package com.asl.website.legalDocuments.service.impl;

import java.util.List;
import com.asl.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.asl.website.legalDocuments.mapper.LegalDocumentsMapper;
import com.asl.website.legalDocuments.domain.LegalDocuments;
import com.asl.website.legalDocuments.service.ILegalDocumentsService;

/**
 * 法律文档Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-06-02
 */
@Service
public class LegalDocumentsServiceImpl implements ILegalDocumentsService 
{
    @Autowired
    private LegalDocumentsMapper legalDocumentsMapper;

    /**
     * 查询法律文档
     * 
     * @param id 法律文档主键
     * @return 法律文档
     */
    @Override
    public LegalDocuments selectLegalDocumentsById(Long id)
    {
        return legalDocumentsMapper.selectLegalDocumentsById(id);
    }

    /**
     * 查询法律文档列表
     * 
     * @param legalDocuments 法律文档
     * @return 法律文档
     */
    @Override
    public List<LegalDocuments> selectLegalDocumentsList(LegalDocuments legalDocuments)
    {
        return legalDocumentsMapper.selectLegalDocumentsList(legalDocuments);
    }

    /**
     * 新增法律文档
     * 
     * @param legalDocuments 法律文档
     * @return 结果
     */
    @Override
    public int insertLegalDocuments(LegalDocuments legalDocuments)
    {
        legalDocuments.setCreateTime(DateUtils.getNowDate());
        return legalDocumentsMapper.insertLegalDocuments(legalDocuments);
    }

    /**
     * 修改法律文档
     * 
     * @param legalDocuments 法律文档
     * @return 结果
     */
    @Override
    public int updateLegalDocuments(LegalDocuments legalDocuments)
    {
        legalDocuments.setUpdateTime(DateUtils.getNowDate());
        return legalDocumentsMapper.updateLegalDocuments(legalDocuments);
    }

    /**
     * 批量删除法律文档
     * 
     * @param ids 需要删除的法律文档主键
     * @return 结果
     */
    @Override
    public int deleteLegalDocumentsByIds(Long[] ids)
    {
        return legalDocumentsMapper.deleteLegalDocumentsByIds(ids);
    }

    /**
     * 删除法律文档信息
     * 
     * @param id 法律文档主键
     * @return 结果
     */
    @Override
    public int deleteLegalDocumentsById(Long id)
    {
        return legalDocumentsMapper.deleteLegalDocumentsById(id);
    }
}
